.class public Lcom/noshufou/android/su/InstallReceiver;
.super Landroid/content/BroadcastReceiver;
.source "InstallReceiver.java"


# static fields
.field private static final TAG:Ljava/lang/String; = "Su.InstallReceiver"


# direct methods
.method public constructor <init>()V
    .locals 0

    .prologue
    .line 31
    invoke-direct {p0}, Landroid/content/BroadcastReceiver;-><init>()V

    return-void
.end method


# virtual methods
.method public onReceive(Landroid/content/Context;Landroid/content/Intent;)V
    .locals 14
    .parameter "context"
    .parameter "intent"

    .prologue
    .line 36
    invoke-virtual {p1}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object v9

    .line 37
    .local v9, pm:Landroid/content/pm/PackageManager;
    invoke-virtual/range {p2 .. p2}, Landroid/content/Intent;->getDataString()Ljava/lang/String;

    move-result-object v10

    const-string v11, ":"

    invoke-virtual {v10, v11}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;

    move-result-object v10

    const/4 v11, 0x1

    aget-object v8, v10, v11

    .line 38
    .local v8, packageName:Ljava/lang/String;
    const/4 v7, 0x0

    .line 41
    .local v7, packageInfo:Landroid/content/pm/PackageInfo;
    const/16 v10, 0x1000

    :try_start_0
    invoke-virtual {v9, v8, v10}, Landroid/content/pm/PackageManager;->getPackageInfo(Ljava/lang/String;I)Landroid/content/pm/PackageInfo;
    :try_end_0
    .catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v7

    .line 48
    invoke-static {p1, v7}, Lcom/noshufou/android/su/util/Util;->isPackageMalicious(Landroid/content/Context;Landroid/content/pm/PackageInfo;)I

    move-result v10

    if-eqz v10, :cond_0

    .line 50
    const-string v10, "notification"

    invoke-virtual {p1, v10}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Landroid/app/NotificationManager;

    .line 51
    .local v4, nm:Landroid/app/NotificationManager;
    new-instance v5, Landroid/app/Notification;

    const v10, 0x7f020034

    .line 52
    const v11, 0x7f0b00bd

    invoke-virtual {p1, v11}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v11

    .line 53
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v12

    .line 51
    invoke-direct {v5, v10, v11, v12, v13}, Landroid/app/Notification;-><init>(ILjava/lang/CharSequence;J)V

    .line 54
    .local v5, notification:Landroid/app/Notification;
    const/high16 v10, 0x7f0b

    invoke-virtual {p1, v10}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v2

    .line 55
    .local v2, contentTitle:Ljava/lang/CharSequence;
    const v10, 0x7f0b00be

    const/4 v11, 0x1

    new-array v11, v11, [Ljava/lang/Object;

    const/4 v12, 0x0

    .line 56
    iget-object v13, v7, Landroid/content/pm/PackageInfo;->applicationInfo:Landroid/content/pm/ApplicationInfo;

    invoke-virtual {v9, v13}, Landroid/content/pm/PackageManager;->getApplicationLabel(Landroid/content/pm/ApplicationInfo;)Ljava/lang/CharSequence;

    move-result-object v13

    aput-object v13, v11, v12

    .line 55
    invoke-virtual {p1, v10, v11}, Landroid/content/Context;->getString(I[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    .line 57
    .local v1, contentText:Ljava/lang/CharSequence;
    new-instance v6, Landroid/content/Intent;

    const-string v10, "android.intent.action.DELETE"

    invoke-virtual/range {p2 .. p2}, Landroid/content/Intent;->getData()Landroid/net/Uri;

    move-result-object v11

    invoke-direct {v6, v10, v11}, Landroid/content/Intent;-><init>(Ljava/lang/String;Landroid/net/Uri;)V

    .line 59
    .local v6, notificationIntent:Landroid/content/Intent;
    const/4 v10, 0x0

    const/4 v11, 0x0

    invoke-static {p1, v10, v6, v11}, Landroid/app/PendingIntent;->getActivity(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;

    move-result-object v0

    .line 60
    .local v0, contentIntent:Landroid/app/PendingIntent;
    invoke-virtual {v5, p1, v2, v1, v0}, Landroid/app/Notification;->setLatestEventInfo(Landroid/content/Context;Ljava/lang/CharSequence;Ljava/lang/CharSequence;Landroid/app/PendingIntent;)V

    .line 61
    iget v10, v5, Landroid/app/Notification;->flags:I

    or-int/lit8 v10, v10, 0x10

    iput v10, v5, Landroid/app/Notification;->flags:I

    .line 62
    const/4 v10, 0x0

    invoke-virtual {v4, v10, v5}, Landroid/app/NotificationManager;->notify(ILandroid/app/Notification;)V

    .line 64
    .end local v0           #contentIntent:Landroid/app/PendingIntent;
    .end local v1           #contentText:Ljava/lang/CharSequence;
    .end local v2           #contentTitle:Ljava/lang/CharSequence;
    .end local v4           #nm:Landroid/app/NotificationManager;
    .end local v5           #notification:Landroid/app/Notification;
    .end local v6           #notificationIntent:Landroid/content/Intent;
    :cond_0
    :goto_0
    return-void

    .line 42
    :catch_0
    move-exception v3

    .line 44
    .local v3, e:Landroid/content/pm/PackageManager$NameNotFoundException;
    const-string v10, "Su.InstallReceiver"

    const-string v11, "PackageManager divided by zero..."

    invoke-static {v10, v11, v3}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    goto :goto_0
.end method
